package com.codeZ.FactoryPattern.original.controller;

import com.codeZ.FactoryPattern.entity.AwardInfo;
import com.codeZ.FactoryPattern.original.service.DiscountService;
import com.codeZ.FactoryPattern.original.service.SmallGiftInfoService;
import com.codeZ.FactoryPattern.original.service.YouKuMemberService;

/**
 * 奖品发放接口
 *
 * @author codeZhang
 * @Date 2024/7/31 11:44
 */
public class DeliverController {

    public void deliverAward(AwardInfo awardInfo) {
        // 奖品类型：1打折券，2优酷会员，3小礼品
        Integer awardTypes = awardInfo.getAwardTypes();
        switch (awardTypes) {
            case 1:
                new DiscountService().sendGift(awardInfo);
                break;
            case 2:
                new YouKuMemberService().sendGift(awardInfo);
                break;
            case 3:
                new SmallGiftInfoService().sendGift(awardInfo);
                break;
            default:
                break;
        }
        System.out.println("奖品发放成功");
    }



}
